import java.util.Scanner;

public class Question2 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入月份");
        int month = scanner.nextInt();
        System.out.println("请输入日期");
        int day = scanner.nextInt();
        //int sum =0
        //switch (month){
        // .........
        // case 5:
        //     sum += 30;
        // case 4:
        //     sum += 31;
        // case 3:
        //     sum += 28;
        // case 2:
        //     sum += 31;
        // case 1:
        //     sum += day;
        //     break;
        // System.out.println("第" + sum + "天");
        // }
        switch (month) {
            case 1:
                System.out.println(day);
                break;
            case 2:
                System.out.println(day + 31);
                break;
            case 3:
                System.out.println(day + 59);
                break;
            case 4:
                System.out.println(day + 90);
                break;
            case 5:
                System.out.println(day + 120);
                break;
            case 6:
                System.out.println(day + 151);
                break;
            case 7:
                System.out.println(day + 181);
                break;
            case 8:
                System.out.println(day + 212);
                break;
            case 9:
                System.out.println(day + 243);
                break;
            case 10:
                System.out.println(day + 273);
                break;
            case 11:
                System.out.println(day + 304);
                break;
            case 12:
                System.out.println(day + 334);
                break;
            default:
        }
    }
}
